package model.redpack.my;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.Date;

public class RedPackStatistics implements Parcelable {
    private long accountId;
    private String accountName;
    private double sendTotalFee;
    private long sendTotal;
    private double getTotalFee;
    private long getTotal;
    private Date beginDate;
    private Date endDate;

    public long getAccountId() {
        return accountId;
    }

    public void setAccountId(long accountId) {
        this.accountId = accountId;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public double getSendTotalFee() {
        return sendTotalFee;
    }

    public void setSendTotalFee(double sendTotalFee) {
        this.sendTotalFee = sendTotalFee;
    }

    public long getSendTotal() {
        return sendTotal;
    }

    public void setSendTotal(long sendTotal) {
        this.sendTotal = sendTotal;
    }

    public double getGetTotalFee() {
        return getTotalFee;
    }

    public void setGetTotalFee(double getTotalFee) {
        this.getTotalFee = getTotalFee;
    }

    public long getGetTotal() {
        return getTotal;
    }

    public void setGetTotal(long getTotal) {
        this.getTotal = getTotal;
    }

    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.accountId);
        dest.writeString(this.accountName);
        dest.writeDouble(this.sendTotalFee);
        dest.writeLong(this.sendTotal);
        dest.writeDouble(this.getTotalFee);
        dest.writeLong(this.getTotal);
        dest.writeLong(this.beginDate != null ? this.beginDate.getTime() : -1);
        dest.writeLong(this.endDate != null ? this.endDate.getTime() : -1);
    }

    public RedPackStatistics() {
    }

    protected RedPackStatistics(Parcel in) {
        this.accountId = in.readLong();
        this.accountName = in.readString();
        this.sendTotalFee = in.readDouble();
        this.sendTotal = in.readLong();
        this.getTotalFee = in.readDouble();
        this.getTotal = in.readLong();
        long tmpBeginDate = in.readLong();
        this.beginDate = tmpBeginDate == -1 ? null : new Date(tmpBeginDate);
        long tmpEndDate = in.readLong();
        this.endDate = tmpEndDate == -1 ? null : new Date(tmpEndDate);
    }

    public static final Creator<RedPackStatistics> CREATOR = new Creator<RedPackStatistics>() {
        @Override
        public RedPackStatistics createFromParcel(Parcel source) {
            return new RedPackStatistics(source);
        }

        @Override
        public RedPackStatistics[] newArray(int size) {
            return new RedPackStatistics[size];
        }
    };
}
